package com.ecoolex.discount.sales.enums;

import com.ecoolex.framework.common.EnumInterface;
import com.ecoolex.framework.common.util.Check;

public enum DiscountProductShelfLifeStrategy implements EnumInterface<DiscountProductShelfLifeStrategy, Integer> {
	UNKNOWN(0, "未知"),
	FIXED(1, "固定"),
	DYNAMIC(2, "动态"),
	;

	private int real;

	private String describe;

	private DiscountProductShelfLifeStrategy(int real, String describe) {
		this.real = real;
		this.describe = describe;
	}

	@Override
	public Integer real() {
		return real;
	}

	@Override
	public String describe() {
		return describe;
	}

	public static DiscountProductShelfLifeStrategy realValueOf(Integer real) {
		if (Check.notNull(real)) {
			for (DiscountProductShelfLifeStrategy v : values()) {
				if (v.real().equals(real)) {
					return v;
				}
			}
		}
		return null;
	}
}
